package com.sky.dto;

import com.sky.pojo.Category;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

@Data
@ApiModel
public class CategoryDTO implements Serializable, Cloneable {

    //主键
    @ApiModelProperty(value = "主键id", required = true)
    private Long id;

    //类型 1 菜品分类 2 套餐分类
    @ApiModelProperty(value = "分类")
    private Integer type;

    //分类名称
    private String name;

    //排序
    private Integer sort;

    @Override
    public Category clone() throws CloneNotSupportedException {
        Category category = new Category();
        //属性拷贝
        BeanUtils.copyProperties(this, category);

        return category;
    }
}
